<?php
declare(strict_types=1);

namespace App\Http\Requests;

class AuthorIdentValidate extends BaseValidate
{
    public function rules(): array
    {
        return [
            "birthday" => "required|date",
            "nickname" => "required|max:20|min:2",
            "remark" => "required|max:100",
            "profession" => "required|exists:user_profession,uid",
            "qr_url" => "required|url",
            "gender" => "required|in:1,2,0",
        ];
    }

    public function messages(): array
    {
        return [
            "nickname.required" => "作者名不能为空",
            "nickname.max" => "作者名2-20个字符",
            "nickname.min" => "作者名2-20个字符",
            "remark.required" => "个人简介不能为空",
            "remark.max" => "简介10-100个字符",
            "remark.min" => "简介10-100个字符",
            "birthday.required" => "生日不能为空",
            "birthday.date" => "生日格式错误",
            "profession.required" => "专业不能为空",
            "profession.exists" => "专业不存在",
            "qr_url.required" => "头像不能为空",
            "qr_url.url" => "头像格式不正确",
            "gender.required" => "性别不能为空",
            "gender.in" => "性别值错误",
        ];
    }
}
